package com.example.denglu.controller;

import com.example.denglu.entity.User;
import com.example.denglu.service.UserService;
import com.example.denglu.service.imp.UserServiceImp;
import com.example.denglu.vo.UserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Api(tags = "首页模块")

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @ApiOperation(value ="登录" )
    @PostMapping("/login")
    public String login(@Valid     @RequestBody UserVo userVo){
        return userService.login(userVo);
    }



     @ApiOperation(value = "注册")
    @PostMapping("/regist")
    public String regist(@Valid        @RequestBody  UserVo uservo){
        return userService.regist(uservo);
    }


    
}
